package com.example.tliaswebmangement.mapper;

import com.example.tliaswebmangement.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {
    /**
     * 查询全部部门
     *
     */
    @Select("select * from test.dept")
    List<Dept> list();

    /**
     * 删除部门
     */
    @Delete("delete from test.dept where id=#{id}")
    void deleteById(Integer id);

    /**
     * 添加部门
     *
     */
    @Insert("insert  into test.dept (name, create_time, update_time) value (#{name},#{createTime},#{updateTime})")
    void insert(Dept dept);

    @Select("select * from test.dept where id=#{id}")
    Dept listById(Integer id);

    @Update("update test.dept set name=#{name},create_time=#{createTime},update_time=#{updateTime} where id=#{id}")
    void update(Dept dept);

}
